@use "../variables";
@use "../mixins";

.form {
  input {
    width: 100%;
    min-width: 275px;
    min-height: 50px;
    padding: 13px 15px 16px;
    font-family: variables.$ff-pt-mono;
    font-weight: 400;
    font-size: 16px;
    line-height: 21px;
    color: variables.$color-default-white;
    -webkit-text-fill-color: variables.$color-default-white;
    background-color: variables.$color-pearl-fade;
    border: none;
    border-radius: 3px;

    &:hover {
      opacity: 0.7;
      }
  }

  .is-invalid input {
    box-shadow: 0 0 0 1px variables.$color-invalid;
  }

  .is-valid input {
    box-shadow: 0 0 0 1px variables.$color-valid;
  }

  @media (max-width: variables.$vp-max-mobile) {
    input {
      min-width: 270px;
    }
  }
}

.form__textarea textarea {
  width: 100%;
  min-height: 155px;
  padding: 23px 15px;
  font-family: variables.$ff-pt-mono;
  font-weight: 400;
  font-size: 16px;
  line-height: 21px;
  color: variables.$color-default-white;
  -webkit-text-fill-color: variables.$color-default-white;
  background-color: variables.$color-pearl-fade;
  border: none;
  border-radius: 3px;


  .is-invalid textarea {
    box-shadow: 0 0 0 1px variables.$color-invalid;
  }

  .is-valid textarea {
    box-shadow: 0 0 0 1px variables.$color-valid;
  }

  @media (max-width: variables.$vp-max-tablet) {
    padding: 30px 15px;
  }

  @media (max-width: variables.$vp-max-mobile) {
    margin-bottom: -31px;
    padding: 23px 15px;
    min-height: 181px;
  }
}

.form__btn {
  display: block;
  padding: 16px 25px 10px;
  max-width: 265px;
  width: 265px;
  margin-bottom: 17px;
  border-radius: 3px;
  text-transform: uppercase;
  font-family: variables.$ff-roboto-condensed;
  font-weight: 700;
  font-size: 16px;
  line-height: 19px;
  letter-spacing: 0.05em;
  background-color: variables.$color-pearl;
  color: variables.$color-default-white;

  @media (max-width: variables.$vp-max-mobile) {
    max-width: unset;
  }

  &:hover,
  &:focus {
    opacity: 0.8;
  }

  &:active {
    opacity: 0.6;
  }
}

.form__checkbox-wrapper {
  padding: 14px 10px;

  span {
    position: relative;
    padding-left: 26px;
    cursor: pointer;
    font-family: variables.$ff-pt-mono;
    font-weight: 400;
    font-size: 14px;
    line-height: 16px;
    color: variables.$color-default-white;
    opacity: 0.8;

    &::before {
      position: absolute;
      top: 8px;
      left: 0;
      content: "";
      display: block;
      width: 15px;
      height: 15px;
      background-image: url("../img/svg/icon-checkbox-unchecked.svg");
    }

    &:hover {
      opacity: 0.7;
    }

    &:active {
      opacity: 0.3;
    }
  }

  label {
    display: flex;
    align-items: center;
  }

  input {
    @include mixins.visually-hidden;
    padding-top: 8px;
  }

  input:checked + span::before {
    background-image: url("../img/svg/icon-checkbox-checked.svg");
  }

  input:focus-visible {
    & + span {
      opacity: 0.7;
    }

    & + span::before {
      outline: variables.$color-pearl auto 1px;
    }
  }

  @media (max-width: variables.$vp-max-tablet) {
    padding: 10px 0;
  }

  @media (max-width: variables.$vp-max-mobile) {
    padding: 5px;
  }
}
